<template>
    <tr>
      <td>
        <input type="checkbox" v-model="check" />
      </td>
      <td>{{name}}</td>
      <td>{{price}}</td>
      <td><button @click="down">-</button>{{num}}<button @click="up">+</button></td>
      <td>{{num*price}}</td>
      <td><button @click="del">删除</button></td>
    </tr>
</template>

<script>
export default {
  props:['name','price','num','index','check'],
  methods:{
    del(){
      this.$emit('remove',this.index)
    },
    down(){
      this.$emit('sub',this.index)
    },
    up(){
      this.$emit('add',this.index)
    },
  }
}
</script>

<style scoped>

</style>
